﻿@page
@{ Layout = "_Layout"; }

<el-row :gutter="1">
    <el-col :span="9">
        <el-card>
            <div slot="header" class="clearfix">
                <span>已选列表</span>
                <el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-minus" v-on:click="btnRemoves">批量移出</el-button>
            </div>
            <el-table ref="tmSelectTable" :data="tmSelectList" :size="euiSize"
                      style="width: 100%" :height="$(window).height()-115">
                <el-table-column type="selection" align="left"
                                 width="28">
                </el-table-column>
                <el-table-column align="left" label="#" type="index" :default-sort="{prop: 'createdDate', order: 'descending'}" width="40">
                </el-table-column>
                <el-table-column show-overflow-tooltip prop="title" label="题目">
                    <template slot-scope="scope">
                        <el-link type="primary" :underline="false" v-on:click="btnTmView(scope.row.id)">
                            <span v-html="scope.row.title" style="color:red;" v-if="scope.row.locked"></span>
                            <span v-html="scope.row.title" v-else></span>
                        </el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="txName" label="题型">
                </el-table-column>
                <el-table-column width="63" align="right">
                    <template slot-scope="scope">
                        <el-link type="warning" size="mini" v-on:click="btnRemove(scope.row.id)">移 出</el-link>
                    </template>
                </el-table-column>
                @await Html.PartialAsync("_PartialTableEmpty")
            </el-table>
        </el-card>
    </el-col>
    <el-col :span="10">
        <el-card>
            <div slot="header" class="clearfix">
                <span>未选列表</span>
                <el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-plus" v-on:click="btnSelects">批量添加</el-button>
            </div>
            <el-table ref="tmTable" :data="tmList" :size="euiSize"
                      style="width: 100%" :height="$(window).height()-158">
                <el-table-column type="selection" align="left"
                                 width="28">
                </el-table-column>
                <el-table-column show-overflow-tooltip prop="title" label="题目">
                    <template slot-scope="scope">
                        <el-link type="primary" :underline="false" v-on:click="btnTmView(scope.row.id)">
                            <span v-html="scope.row.title" style="color:red;" v-if="scope.row.locked"></span>
                            <span v-html="scope.row.title" v-else></span>
                        </el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="txName" label="题型">
                </el-table-column>
                <el-table-column prop="score" label="分数" width="63">
                </el-table-column>
                <el-table-column label="难度" width="63">
                    <template slot-scope="scope">
                        <span v-html="scope.row.nanduStar"></span>
                    </template>
                </el-table-column>
                <el-table-column width="63" align="right">
                    <template slot-scope="scope">
                        <el-link size="mini" type="success" v-on:click="btnSelect(scope.row.id)">添 加</el-link>
                    </template>
                </el-table-column>
                @await Html.PartialAsync("_PartialTableEmpty")
            </el-table>

            <div style="text-align: center; margin-top: 10px;">
                <el-pagination v-on:current-change="handleCurrentChange" background
                               :current-page="formInline.pageIndex"
                               :page-size="formInline.pageSize"
                               layout="total, prev, pager, next"
                               :total="tmTotal">
                </el-pagination>
            </div>
        </el-card>
    </el-col>
    <el-col :span="5">
        <el-card>
            <div slot="header" class="clearfix">
                <span>未选列表-查询</span>
            </div>
            <el-form :size="euiSize">
                <el-form-item label="">
                    <el-input placeholder="分类关键字查询" v-model="treeFilterText" prefix-icon="el-icon-search" clearable>
                        <template slot="append">
                            <el-tooltip content="未选列表查询是否包含下级" placement="top">
                                <el-checkbox v-model="formInline.treeIsChildren"></el-checkbox>
                            </el-tooltip>
                        </template>
                    </el-input>
                </el-form-item>
            </el-form>
            <el-scrollbar class="scrollbar" :style="{height: $(window).height()-463 + 'px'}">
                <el-tree class="filter-tree"
                         :data="treeItems" :expand-on-click-node="false"
                         v-on:node-click="treeNodeClick"
                         v-on:node-expand="treeNodeExpand"
                         v-on:node-collapse="treeNodeCollapse"
                         node-key="value"
                         accordion
                         :default-expanded-keys="treeDefaultExpandedKeys"
                         :filter-node-method="treeFilterNode"
                         ref="tree">
                    <template slot-scope="{ node,data }">
                        <span style="width:100%">{{ node.label }}<span style="color:darkgray;font-size:12px;">({{ data.selfTotal }}/{{ data.total }})</span></span>
                    </template>
                </el-tree>
            </el-scrollbar>
        </el-card>
        <el-card>
            <el-form :size="euiSize">
                <el-form-item label="">
                    <el-select v-model="formInline.txId" placeholder="请选择题型" clearable v-on:change="btnSearchClick" style="width:100%;">
                        <el-option v-for="tx in txList"
                                   :key="tx.id"
                                   :label="tx.name"
                                   :value="tx.id">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item label="">
                    <el-select v-model="formInline.nandu" placeholder="请选择难度" clearable v-on:change="btnSearchClick" style="width:100%;">
                        <el-option v-for="nd in 5"
                                   :key="nd"
                                   :value="nd">
                            {{ nd }}<i class="el-icon-star-on" style="color:#FF9900;margin-left:3px;font-size:14px;"></i>
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="">
                    <el-select v-model="formInline.order" placeholder="排序" clearable v-on:change="btnSearchClick" style="width:100%;">
                        <el-option label="难度" value="nandu"></el-option>
                        <el-option label="分数" value="score"></el-option>
                        <el-option label="题型" value="tx"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="">
                    <el-input v-model="formInline.keyword" placeholder="关键字" clearable prefix-icon="el-icon-search"></el-input>
                </el-form-item>
                <el-form-item style="text-align:center;">
                    <el-button icon="el-icon-search" type="primary" v-on:click="btnSearchClick">查 询</el-button>
                    <el-button icon="el-icon-close" v-on:click="utils.closeLayerSelf">关 闭</el-button>
                </el-form-item>
            </el-form>
        </el-card>
    </el-col>
</el-row>
@section Scripts{
    <script src="/sitefiles/assets/js/admin/exam/examTmSelect.js" type="text/javascript"></script>
}